package org.umss.fixturebuilder.builder;

import java.util.List;
import org.umss.fixturebuilder.builder.data.DataSource;
import org.umss.fixturebuilder.builder.data.DataSourceException;
import org.umss.fixturebuilder.builder.model.Phase;
import org.umss.fixturebuilder.builder.model.Team;

/**
 *
 * @author Daniela Meneses
 */
public class BuilderManager {

    private final List<Team> teams;
    private final PhaseBuilder builder;

    public BuilderManager(DataSource dataSource, PhaseBuilder builder) throws DataSourceException {
        this.teams = dataSource.getTeams();
        this.builder = builder;
    }
    
    public List<Team> getTeams() {
        return teams;
    }   

    public Phase generateFixture() throws PhaseBuilderException {
        return builder.generatePhase(teams);
    }
}
